import { post, get } from './request';
import type { StockModel } from '@/model/stockmodel';
const stockIn = (arg: { place_id: string; qty: number; sub_order_code: string }) => {
  return post<StockModel>('StockRecord/StockIn', arg);
};
const stockOut = (arg: { src: string; qty: number }) => {
  return post<StockModel>('StockRecord/StockOut', arg);
};
const removeStockOut = (pk: string) => {
  return get<string>('StockRecord/Delete', { pk: pk });
};
const listStock = (keyword: string) => {
  return get<StockModel>('StockRecord/SearchByKeyword', { keyword: keyword });
};
const getStock = (pk: string) => {
  return get<StockModel>('StockRecord/Get', { pk: pk });
};
const listStockOut = (pk: string) => {
  return get<StockModel>('StockRecord/ListOutRecord', { pk: pk });
};

export { stockIn, listStock, getStock, listStockOut, stockOut, removeStockOut };
